home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_force_defense.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
2KB
|
75 lines
# Jedi Knight Cog Script
#
# FORCE_DEFENSE.COG
#
# Force Defense
# Bin 19
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing player local
flex damage local
flex type local
int rank local
sound defenseSound=ForceDefense.wav local
message startup
message damaged
message timer
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
SetInvActivated(player, 19, 0);
Return;
# ........................................................................................
damaged:
rank = GetInv(player, 19);
damage = GetParam(0);
// if type of damage is FORCE
if(GetParam(1) == 8)
{
damage = damage * (1 - rank * 0.125);
if(rank != 0)
{
// Play defense sound
PlaySoundThing(defenseSound, player, 1.0, -1, -1, 0x80);
// Flash the defense icon for 0.5 seconds if it
// is not already there, else add to the duration
SetInvActivated(player, 19, 1);
KillTimerEx(1);
SetTimerEx(0.5, 1, 0, 0);
}
}
ReturnEx(damage);
Return;
# ........................................................................................
timer:
SetInvActivated(player, 19, 0);
Return;
end